﻿/// <reference path="../../JQ/Controls/ControlType.js" />
/// <reference path="../../JQ/jquery-1.10.2.js" />

var ControlProperty = {
    getProperty: function (ctype) {
        /// <summary>根据控件类型，获得控件支持的属性列表</summary>
        /// <param name="ctype" type="String">控件类型</param>
        if (ctype === ControlType.input) {
            return [{ title: '文本', controlType: 'input', controlConfig: { css: { 'width': '100%'}} },
                { title: '数据类型', controlType: 'combobox', controlConfig: { css: { 'width': '100%' }, dropdownStyle: 'dropDownList', listItems: 'text;int;float', defaultVal: 'text'} }
            ];
        }
        if (ctype === ControlType.combobox) {
            return [{ title: '下拉类型', controlType: 'combobox', controlConfig: { css: { 'width': '100%' }, dropdownStyle: 'dropDownList', listItems: '可输入|dropDown;不可输入|dropDownList', defaultVal: '不可输入|dropDownList'}}];
        }
        if (ctype === ControlType.label) {
            return [{ title: '文本', controlType: 'input', controlConfig: { css: { 'width': '100%'}}}];
        }
        if (ctype === ControlType.button) {
            return [{ title: '文本', controlType: 'input', controlConfig: { css: { 'width': '100%'}}}];
        }
        if (ctype === ControlType.fieldset) {
            return [{ title: '标题', controlType: 'input', controlConfig: { css: { 'width': '100%'}}}];
        }
    },
    getDesignConfig: function (ctype) {
        /// <summary>根据控件类型，获取设计时候控件的配置参数</summary>
        /// <param name="ctype" type="String">控件类型</param>
        if (ctype === ControlType.combobox) {
            return { moveEnable: true, disableAllEvent: true, bFocusFireDropFun: false, moveRangeParent: 'designZone' };
        }
        if (ctype === ControlType.label) {
            return { moveEnable: true, moveRangeParent: 'designZone' };
        }
        if (ctype === ControlType.input) {
            return { moveEnable: true, moveRangeParent: 'designZone' };
        }
        if (ctype === ControlType.button) {
            return { moveEnable: true, moveRangeParent: 'designZone' };
        }
        if (ctype === ControlType.fieldset) {
            return { moveEnable: true, moveRangeParent: 'designZone' };
        }
    }
};